Public Class Equipo

    Private nombre As String
    Private id As Integer
    Private idGrupo As Integer
    Private objDesglose As Desglose

    Public Sub New()

    End Sub


    Public Sub insertarDatos(ByVal pidG As Integer, ByVal pnombre As String)
        Me.idGrupo = pidG
        If Not Trim(pnombre) = "" Then
            Me.nombre = pnombre
        Else
            Throw New ArgumentException("Debe indicar el nombre del equipo")
        End If
    End Sub

    Public Sub New(ByVal pidE As Integer)
        Me.id = pidE
    End Sub

    Public Sub New(ByVal pidE As Integer, ByVal pidG As Integer)
        Me.id = pidE
        Me.idGrupo = pidG
    End Sub

    Public Sub insertese()
        Dim da As New accesoBD.TripleCDataSetTableAdapters.QueriesTableAdapter
        da.registrarEquipo(Me.idGrupo, Me.nombre)
    End Sub

    Public Sub actualicese()
        Dim da As New accesoBD.TripleCDataSetTableAdapters.QueriesTableAdapter
        da.modificarEquipo(Me.idGrupo, Me.id, Me.nombre)
    End Sub

    Public Function obtenerDesglose() As DataTable
        Me.objDesglose = New Desglose(Me.id)
        Return Me.objDesglose.verDesgloseGrupal()
    End Function

    Public Function obtenerPromedio() As ArrayList
        Me.objDesglose = New Desglose(Me.id)
        Return Me.objDesglose.obtenerRendimientoGrupal()
    End Function

    Public Sub modificarNota(ByVal pidG As Integer, ByVal pidR As Integer, ByVal pnota As String)
        'Me.obtenerIdEquipo()
        Me.objDesglose = New Desglose(Me.id)
        Me.objDesglose.asignarNotaEquipo(pidR, pnota)
    End Sub

    Public Function obtenerNotasEstudiantes(ByVal pidR As Integer) As DataTable
        Me.objDesglose = New Desglose(Me.id)
        Return Me.objDesglose.obtenerEvaluacionesEstudiantes(pidR)
    End Function

    Public Function obtenerSumatoria(ByVal pidR As Integer) As String
        Me.objDesglose = New Desglose(Me.id)
        Return Me.objDesglose.obtenerSumaoria(pidR)
    End Function

End Class
